//
//  SearchCollectionViewCell.m
//  WuLi
//
//  Created by Gollum on 16/9/18.
//  Copyright © 2016年 Gollum. All rights reserved.
//

#import "SearchCollectionViewCell.h"

@implementation SearchCollectionViewCell

- (void)awakeFromNib {
    // Initialization code
    [super awakeFromNib];
    [_contentButton.layer setMasksToBounds:YES];
    [_contentButton.layer setCornerRadius:12.0];
    [_contentButton setBackgroundColor:[UIColor colorWithWhite:0.957 alpha:1.000]];
}

+ (CGSize)getSizeWithText:(NSString *)text{

    NSMutableParagraphStyle* style = [[NSMutableParagraphStyle alloc] init];
    style.lineBreakMode = NSLineBreakByCharWrapping;
    CGSize size = [text boundingRectWithSize:CGSizeMake(CGFLOAT_MAX, 24) options: NSStringDrawingUsesLineFragmentOrigin   attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:12.0f],NSParagraphStyleAttributeName:style} context:nil].size;
    return CGSizeMake(size.width+20, 24);

}



- (IBAction)slect:(id)sender {
    
    if ([self.slectDelegate respondsToSelector:@selector(selectButttonClick:)]) {
        [self.slectDelegate selectButttonClick:self];
    }
    
    
}

@end
